#ifdef KITSCHY_DEBUG_MEMORY 
#include "debug_memorymanager.h"
#endif

#include "stdio.h"
#include "stdlib.h"
#include "string.h"
#include "math.h"

#include "BList.h"
#include "BVector.h"
#include "geometrics.h"
#include "quaternion.h"
#include "symbol.h"
#include "sort.h"
#include "ontology.h"
#include "featureterm.h"
#include "FTKBase.h"

#include "AWLocalViewport.h"

#include "AWEntity.h"
#include "AWMessage.h"
#include "AWScenario.h"
#include "AWBody.h"
#include "AWSensor.h"
#include "AWBrain.h"
#include "AWAgent.h"
#include "AWWorld.h"

#include "loader.h"

#include "AWMonitorBrain.h"


AW_MonitorBrain::AW_MonitorBrain(Ontology *O,FTKBase *Memory) : AW_Brain(O,Memory) 
{
	class_name->set("AW_MonitorBrain");


} /* AW_MonitorBrain::AW_MonitorBrain */ 


AW_MonitorBrain::AW_MonitorBrain(FILE *fp,Ontology *O,FTKBase *Memory) : AW_Brain(O,Memory)
{
	class_name->set("AW_MonitorBrain");


	load(fp);
} /* AW_MonitorBrain::AW_MonitorBrain */ 


AW_MonitorBrain::~AW_MonitorBrain()
{
} /* AW_MonitorBrain::~AW_MonitorBrain */ 


bool AW_MonitorBrain::load(FILE *fp) 
{
	if (!AW_Brain::load(fp)) return false;


	return true;
} /* AW_MonitorBrain::load */ 


bool AW_MonitorBrain::save(FILE *fp) 
{
	if (!AW_Brain::save(fp)) return false;


	return true;
} /* AW_MonitorBrain::save */ 


bool AW_MonitorBrain::is_a(char *c)
{
	if (strcmp(c,"AW_MonitorBrain")==0) return true;

	return AW_Brain::is_a(c);
} /* AW_MonitorBrain::is_a */ 


bool AW_MonitorBrain::is_a(Symbol *c)
{
	if (c->cmp("AW_MonitorBrain")) return true;

	return AW_Brain::is_a(c);
} /* AW_MonitorBrain::is_a */ 


void AW_MonitorBrain::actualize(float ,float ,List<AW_Message> *message_queue,
						 Symbol *,
						 List<FeatureTerm> *,						
						 List<FeatureTerm> *,List<FeatureTerm> *l)
{
	AW_Message *m;
	FeatureTerm *op;

	message_queue->Rewind();
	while(message_queue->Iterate(m)) {
		op=new FeatureTerm((char *)0,m_ontology->get_sort("text-operator"),1,
						   "text",new FeatureTerm((Symbol *)0,new Symbol(m->content),m_ontology));

		l->Add(op);
	} /* while */ 
} /* AW_MonitorBrain::actualize */ 

